<template>
  <div class="home">
    <div class="header">
      <van-cell-group is-link @click="showPopup">
        <van-icon name="wap-nav" />
      </van-cell-group>
      <van-icon name="search" @click="skipPage('Search')"/>
      <van-popup v-model:show="show" position="left">
        <div class="aside">
          <div class="account">
            <van-image fit="cover" position="left" round width="70" height="70" src="https://img.yzcdn.cn/vant/cat.jpeg" />
          </div>
          <div class="log">
            <span>退出登录</span>
          </div>
        </div>
      </van-popup>
    </div>
    <div class="main">
      <router-view></router-view>
    </div>
    <Player></Player>
    <div class="footer">
      <van-row>
        <van-col span="6">
          <router-link exact-active-class="active" :to="{ name: 'home' }">
            <van-icon name="wap-home-o" />
          </router-link>
        </van-col>
        <van-col span="6">
          <van-icon name="friends-o" @click="skipPage('Concern')"/>
        </van-col>
        <van-col span="6">
          <van-icon name="music-o" @click="skipPage('Account')"/>
        </van-col>
        <van-col span="6">
          <van-icon name="bullhorn-o" @click="skipPage('Village')"/>
        </van-col>
      </van-row>
    </div>
  </div>
</template>

<script>
// @ is an alias to /src
import { ref } from 'vue';
import { useRoute, useRouter } from "vue-router"
import Player from "../components/Player"
export default {
  name: 'HomeView',
  components:{Player},
  setup() {
    const show = ref(false);
    const showPopup = () => {
      show.value = true;
    };

    const route = useRoute()
    const router = useRouter()
    const skipPage = (page) => {
      router.push({
        name: page,
      })
    }
    return {
      show,
      showPopup,
      skipPage
    };
  },
}
</script>
<style scoped lang="less">
  .home{
    height: 50rem;
  }
  .header{
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: indianred;
  }
  .van-icon{
    font-size: 27rem;
    margin:0 12rem;
    color: dimgrey;
  }
  .van-cell-group{
    height: 100%;
    line-height: 57rem;
    background-color: transparent;
  }
  .aside{
    height:700rem ;
    width: 300rem;
    background-color: aliceblue;
  }
  .account{
    position: absolute;
    top:20rem;
    left:10rem;
  }
  .log{
    font-size: 25rem;
    color: darkred;
    position: fixed;
    bottom: 10rem;
    left: 50rem;
    border-radius: 5rem;
    background-color: skyblue;
    width: 150rem;
    height: 40rem;
    line-height: 40rem;
    padding-left: 50rem;
  }
  .footer{
    background-color:lightpink;
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 50rem;
    font-size: 25rem;
    line-height: 55rem;
  }
</style>
